package com.infore.siteManagement.controller.ddic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.entity.ddic.DdicFalutType;
import com.infore.siteManagement.select.dto.QueryParamDto;
import com.infore.siteManagement.service.ddic.IFalutTypeService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "故障类型管理接口", tags = { "故障类型理接口" })
@RestController
@RequestMapping("/falutType")
public class FalutTypeController {

	@Autowired
	private IFalutTypeService iFalutTypeService;

	@ApiOperation(value = "查询故障类型通用接口")
	@ResponseBody
	@PostMapping(value = "/query")
	public ResultEntity query(@RequestBody(required = false) QueryParamDto queryParamDto) {
		return iFalutTypeService.query(queryParamDto);
	}

	@ApiOperation(value = "删除故障类型通用接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "故障类型id", name = "ids", paramType = "query", required = true, dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity delete(String ids) {
		return iFalutTypeService.delete(ids);
	}

	@ApiOperation(value = "编辑/新增故障类型通用接口")
	@ResponseBody
	@PostMapping(value = "/edit")
	public ResultEntity edit(@RequestBody DdicFalutType ddicFalutType) {
		return iFalutTypeService.edit(ddicFalutType);
	}

}
